<% option explicit %> <% dim Scriptpath, Scriptname 'dim Family, Genus, Species, Common, Wildcard dim strAccGenus dim blnNoShow dim Criteria, Prefix dim MySQL dim RS, RSTemp dim MyFam, MyTaxcd dim strsql dim rsresults dim family, genus, species, taxcd, common, Wildcard dim blnsametaxon %> Wisconsin Vascular Plants: Search Results

Vascular Plants Search Results

Click on taxon for details including: Photos ( * ), Distribution Maps ( + ), Habitats, and other links.

<% Scriptpath="../scripts/" Scriptname="detail.asp" IF Request.ServerVariables("REQUEST_METHOD")="POST" THEN Family = Request.Form("Family") Genus = Request.Form("Genus") Species = Request.Form("Species") Common = Request.Form("Common") Wildcard = Request.Form("Wildcard") END IF IF Request.ServerVariables("REQUEST_METHOD")="GET" THEN Family = Request.QueryString("Family") Genus = Request.QueryString("Genus") Species = Request.QueryString("Species") Common = Request.QueryString("Common") Wildcard = Request.QueryString("Wildcard") END IF ' Capitalize Family and Genus, lowercase Species Family = TRIM(Family) Family = UCASE(LEFT(Family,1)) & LCASE(MID(Family,2)) Genus = TRIM(Genus) Genus = UCASE(LEFT(Genus,1)) & LCASE(MID(Genus,2)) Species = LCASE(TRIM(Species)) Common = UCASE(TRIM(Common)) ' Take care of single quotes Family = replace(Family,"'","") Genus = REPLACE(Genus,"'","") Species = REPLACE(Species,"'","") Common = REPLACE(Common,"'","''") ' Assemble criteria string for SQL Criteria = "" Prefix = " WHERE" IF Wildcard <> "" THEN IF Family <> "" THEN Criteria = Criteria & Prefix & " (Family LIKE '" & Family & "%') " Prefix = " AND" END IF IF Genus <> "" THEN Criteria = Criteria & Prefix & " (Genus LIKE '" & Genus & "%') " Prefix = " AND" END IF IF Species <> "" THEN Criteria = Criteria & Prefix & " (Species LIKE '" & Species & "%') " Prefix = " AND" END IF ELSE IF Family <> "" THEN Criteria = Criteria & Prefix & " (Family = '" & Family & "') " Prefix = " AND" END IF IF Genus <> "" THEN Criteria = Criteria & Prefix & " (Genus = '" & Genus & "') " Prefix = " AND" END IF IF Species <> "" THEN Criteria = Criteria & Prefix & " (Species = '" & Species & "') " Prefix = " AND" END IF END IF IF Common <> "" THEN Criteria = Criteria & Prefix & " ( Common LIKE '%" & Common & "%') " END IF 'Criteria = Criteria & "AND (Wisc_Found = 'W')" IF Criteria <> "" THEN strsql = "SELECT taxcd, syncd, genus, family, species, common, status_code, photo, thumbmaps, hand, Wisc_Found " _ & "FROM spdetail " _ & "WHERE Taxcd IN ( " _ & "SELECT DISTINCT Taxcd FROM spdetail " & Criteria _ & ") ORDER BY Family, Taxcd, Syncd" 'response.write strsql if retrieveRS(rsresults, strsql, interrornum, strerrormsg) then call ffWriteODBCError(strsql) 'response.write MySQL & "
" if session("adminedit") = 1 then Response.Write("") end if family = "" genus = "" species = "" taxcd = "" common = "" if not rsresults.EOF then while not rsresults.EOF if trim(rsresults("syncd")) = "." and isnull(rsresults("Wisc_Found")) then 'response.write "

HERE


" taxcd = trim(rsresults("taxcd")) blnsametaxon = true while not rsresults.EOF and blnsametaxon if taxcd = trim(rsresults("taxcd")) then rsresults.movenext else blnsametaxon = false end if wend else IF trim(family) <> trim(rsresults("Family")) THEN family = trim(rsresults("Family")) %>
      Family <% = family %>    (Family Information, Photo Gallery and Map Gallery)
<% END IF IF trim(taxcd) <> trim(rsresults("Taxcd")) THEN 'IF Not blnNoShow Then taxcd = rsresults("Taxcd") 'NOTE: I MUST STILL FIND OUT WHAT THE PURPOSE OF ACCGENUS IS!!! 'IF strAccGenus <> rsresults("AccGenus") THEN ' strAccGenus = rsresults("AccGenus") if genus <> rsresults("Genus") then genus = rsresults("Genus") %> <% END IF %>             <% ' response.write rsresults("taxcd") & "
" ' response.write rsresults("genus") & "
" ' response.write rsresults("family") & "
" ' response.write rsresults("species") & "
" if isnull(rsresults("common")) then common = "" else common = trim(rsresults("common")) end if if isnull(rsresults("species")) then species = "" else species = trim(rsresults("species")) end if %> &Genus=<%=server.URLencode(rsresults("genus"))%>&Family=<%=server.URLencode(rsresults("Family"))%>&Species=<%=server.URLencode(species)%>&Common=<%=server.URLencode(common)%>"><%=getTaxonNm(rsresults("Taxcd"), rsresults("Syncd"))%> <% IF trim(rsresults("status_code")) = "x" or trim(rsresults("status_code")) = "xt" THEN Response.Write(" [Excluded] ") END IF IF rsresults("Photo") <> "" THEN Response.Write(" *") END IF IF rsresults("Thumbmaps") > "." or rsresults("Hand") = "H" THEN Response.Write(" +") END IF %>

<% IF rsresults("Common")<>"" THEN %>               <%=rsresults("Common")%>
<% END IF ' RS("Common")<>"" 'END IF ' Not blnNoShow ELSE %>                   <%=getTaxonNm(rsresults("Taxcd"), rsresults("Syncd"))%>
<% END IF rsresults.MoveNext end if WEND else %>      No matches were found for your search.
<% end if call closeRS(rsresults) ELSE %>      I don't understand what you are trying to search for.
<% END IF %>